/*
 * *
 *  * Created with IntelliJ RustRover.
 *  * Description:
 *  * Copyright Author: ZhenYi
 *  * DateTime: 2024/2/15 下午4:31
 *
 */

pub mod maun;
pub mod user;


use salvo::prelude::BasicAuth;
use salvo::Router;
use crate::middleware::auth_basic::BasicAuthAdmin;
use crate::middleware::auth_cookie::check_admin;

/// 管理端路由
/// admin/maun 稿件路由
/// admin/user 用户路由
/// admin/setting 设置路由 todo
/// admin/log 日志路由 todo
/// admin/statistics 统计路由 todo
/// admin/mutual 互动路由 todo
pub(crate) fn admin_route() -> Router {
    let auth = BasicAuth::new(BasicAuthAdmin);
    Router::new()
        .hoop(auth)
        .hoop(check_admin)
        .push(
            Router::with_path("admin")
                .push(maun::maun_route())
                .push(user::user_route())
        )

}